package com.sxt;

import java.awt.*;

public class Gold extends Object{//普通金块
    Gold(){
        this.x = (int)(Math.random()*700);
        this.y = (int)(Math.random()*550+300);
        this.width = 32;
        this.height = 52;
        this.flag = false;
        this.m = 30;
        this.count = 4;
        this.type = 1;
        this.img  = Toolkit.getDefaultToolkit().getImage("C://Users//admin//IdeaProjects//The Gold Miner//imgs//gold1.gif");
    }
}
//写一个不同类型的金块类继承金块这个父类，然后通过无参构造方法去重写里面的不同属性值
class GoldMini extends Gold{//小金块
    GoldMini(){
        this.width = 36;
        this.height = 36;
        this.m = 15;
        this.count = 2;
        this.img  = Toolkit.getDefaultToolkit().getImage("C://Users//admin//IdeaProjects//The Gold Miner//imgs//gold0.gif");
    }
}
class GoldPlus extends Gold{//大金块
    GoldPlus(){
        this.x = (int)(Math.random()*650);//重置大金块的横坐标
        this.width = 105;
        this.height = 105;
        this.m = 60;
        this.count = 8;
        this.img  = Toolkit.getDefaultToolkit().getImage("C://Users//admin//IdeaProjects//The Gold Miner//imgs//gold2.gif");
    }
}
